from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from sensorapp import app, config

# https://www.cnblogs.com/yaoshi641/p/14386387.html
# WINDOWS下部署 FLASK (WIN10+FLASK+NGINX)
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(config["server"]["port"], config["server"]["host"])  # flask默认的端口
print(
    f'[tornado]Running on http://{config["server"]["host"]}:{config["server"]["port"]}'
)
IOLoop.current().start()
